package cn.bdqn.web;

//public class AuthorizationInterceptor implements HandlerInterceptor {
//    /**
//     * true 不拦截可以通过
//     * @param request
//     * @param response
//     * @param handler
//     * @return
//     * @throws Exception
//     */
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        //判断用户是否登录
//        User loginUser = (User)request.getSession().getAttribute("loginUser");
//        if (loginUser==null){
//            response.setContentType("text/html; charset=UTF-8");
//            PrintWriter out = response.getWriter();
//            out.print("<script>alert('没有登录；请先去登录');location.href='/login';</script>");
//            return false;
//        }
//        return true;
//    }
//}
